Apache server stats with small and useful bash script.

2013-11-29 3 min read Bash Linux Uncategorized Wordpress

Just copy this script to your web-server cgi-bin directory and enjoy.

The script with show the common errors like 404 Error, Internal Server Error and others. It will show the User agent distribution using simple commands like grep, uniq, awk and so on.

You would need to change the tfile – which is temporary file and also the access.log path in the next line.

Just re-direct the output to some file with html extenstion. You could even put this in the cron which re-directs the output to some html in server document root.

Continue reading

phpmyadmin access problem and change server from URL

2012-09-30 1 min read Database Fedora

I was having issues with one of the phpmyadmin setups. The first server defined in the config file was not accessible and the theme that I was using was not allowing me to change the server from the first page. This resulted in a state where I was not able to access phpmyadmin in any way. I could not connect to any of the servers. And thus had to hack my way in to phpmyadmin to find out how to connect to other servers from URL. And here is my finding:

Continue reading

xmlwf – Is your xml document well formed?

2012-02-18 1 min read Bash

There is a small nifty utility called xmlwf that can check your xml documents to see if they are well formed.

sudo yum install expat

Once installed, simply use :

xmlwf

Need more details, just check the man page 🙂

Enhanced by Zemanta

Fast and bleeding edge Firefox.. version 7

2011-06-30 2 min read Firefox

Firefox 7.0 nightly builds have started and it seems to be quite fast. So, if you dont care about some sites not opening or once in a while your browser crashing, been using for 2 days on Windows , has not crashed so far and worked on all sites so far :), then you should install the Nightly build.

Head over to the nightly build site and install the appropriate build for your OS.

Continue reading

faster bash operations on files with File Descriptors.

2011-06-11 2 min read Bash Learning Linux

I was writing a bash script that would do some operations and read and write to file. Seems that that was pretty simple with

  <td>
    <div class="text codecolorer">
      while read line<br /> <br /> do<br /> <br /> done<file
    </div>
  </td>
</tr>
1
2
3
4
5

and then use redirection operations like “>” and “»” to write to file. Done with the script pretty fast. So far so good, when I went for real life tests, no one was interested in using it, why? Simple, it was simply taking too long. The file was reading about 10K lines and writing about 50 lines and was taking about more than 10 minutes.

Continue reading

analyze debug queries output for wordpress

2011-02-09 2 min read Wordpress

Some time back, my website became too slow and I started getting timeout response for quite a lot of my pages. When I analyzed things, I found the issue was with the DB queries taking a lot of time. So, I thought of getting my hands dirty and started with installing the plugin “Debug Queries”. Just in case, you don’t know about the plugin, it lists all the queries to DB along with the time taken for the query when a Admin user visits any page.

Continue reading

cURL – Tutorial

2010-09-15 1 min read Bash Fedora Linux

Here are linkw to two nice tutorials on curl and how to use curl to login before we try to fetch a page. Hope you find them useful.
http://curl.haxx.se/docs/httpscripting.html

http://www.youtube.com/watch?v=XcgQUsorF_8

http://scriptasy.com/php_11/tutorial-curl-login_44.html

Enhanced by Zemanta
Older posts